﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IHISCETeim.DAL;
using IHISCETeim.Model;
using IHISCETeim.Library;
using System.Data;

namespace IHISCETeim.BLL
{
    public class SEMailListController
    {
        public static int Add(string MailTo, string Subject, string Body,int EmailType=0)
        {
            return SEMailListDAL.Add(MailTo, Subject, Body, EmailType);
        }
        public static List<SEMailListInfo> GetAllNeedSendList(int EmailType=0)
        {
            return CBO.FillCollection<SEMailListInfo>(SEMailListDAL.GetAllNeedSendList(EmailType));
        }
        public static bool UpdateSend(int ID)
        {
            return SEMailListDAL.UpdateSend(ID);           
        }
        /// <summary>
        /// 添加程序错误
        /// </summary>
        /// <param name="errorsoure"></param>
        /// <param name="errormsg"></param>
        public static void AddAppError(string realname, string errorsoure, string errormsg)
        {
            SEMailListDAL.Add("yeyanxin@ihisce.com", "IHISCE信息平台程序错误", string.Format("操作页面:{0}<br/>操作人员:{1}<br/>错误内容:<br/>{2}<br/>", errorsoure, realname, errormsg));
        }
    }
}
